<?php
namespace addons\yalimedia\service;

use app\admin\model\yalimedia\Uservip;

class User
{

    public $model;


    public static function isVip($user_id){

        $userVipModel = new Uservip();
        $userVip = $userVipModel->where(['user_id'=>$user_id])->find();
        if($userVip){
            if($userVip['expiretime'] === 0){
               return 1;
            }else{
                if($userVip['expiretime']>time()){
                    return 1;
                }else{
                    return 0;
                }
            }
        }else{
            return 0;
        }
    }

}